import axios from "axios";
import NProgress from "nprogress";
import "nprogress/nprogress.css";

const service = axios.create({
  // baseURL: 'http://itfly.vip',
  // baseURL: 'http://127.0.0.1:3000'
  // baseURL: process.env.VUE_APP_BASE_API
  baseURL: "http://10.41.9.84:8888",
});

// 请求拦截
service.interceptors.request.use((config) => {
  // if (localStorage.token) {
  // config.headers.authorization = 'token'
  // }
  NProgress.start();
  return config;
});

// 响应拦截
service.interceptors.response.use((response) => {
  NProgress.done();
  return response;
});

export default service;
